<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>打印机</title>
</head>
<style>
    *{
        padding: 0;
        margin: 0;
    }
    .print-box {
	    width: 100%;
        font-size: 12px;
    }
    .print-box div {
        width: 100%;
        margin: 5px 0;
    }
    .print-box .divider-line {
        height: 0;
        border-bottom: 1px dotted #000000;
    }
    .print-box .title {
        text-align: center;
    }
    .print-box .food {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }
    .print-box .food .food-name {
	    flex: 1;
    }
    .print-box .food .price {
        width: 80px;
        flex-shrink: 0;
        text-align: right;
    }
    .print-box .bottom-bar {
	    text-align: center;
    }
</style>
<body>
</body>
<script>
	const { ipcRenderer } = require('electron')
	// 监听从主进程打印窗体webContents传递过来的打印事件
	ipcRenderer.on('render-print', (event, info) => {
		document.body.innerHTML = info.html
		// 页面html渲染后发送事件到主进程
		ipcRenderer.send('print-do', info.deviceName)
	})
</script>
</html>
